import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import {LayoutComponent} from './layout/layout.component';
import {HomeComponent} from './views/home/home.component';
import {IntroduceComponent} from './views/introduce/introduce.component';
import {HomeworkListComponent} from './views/homework-list/homework-list.component';
import {CourseComponent} from './views/course/course.component';

const routes: Routes = [
  {path: '', redirectTo: 'home', pathMatch: 'full'},
  {
    path: '',
    component: LayoutComponent,
    children: [
      {path: 'home', component: HomeComponent},
      {path: 'introduce', component: IntroduceComponent},
      {path: 'homework/homeworkList', component: HomeworkListComponent},
      {path: 'homework/course', component: CourseComponent},
    ]
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
